<?php

class washingtime{
	private $id;
	private $starttime;
	private $endtime;
	private $owner_id;
	private $owner_name;
	private $owner_flat;
	
	
	function __construct($starttime,$endtime,$owner_id,$userid,$mydb){
		
		//werte füllen
	}
	
	
	
	function __construct($mydb){
		//aus DB laden
		//werte füllen
	}
	
	public static function insertInto($mydb){
		//get $userid
		$mydb->query("	INSERT INTO waschzeiten
					 	VALUES( NULL,
					 			$USERID
					 			)");
								
	}
	
	public static function toJSON(){
		return "{
				\"id\":$id,
                \"start\": new Date($starttime*1000),
                \"end\": new Date($endtime*1000),
                \"title\":\"$owner_name<br>$owner_flat\",
                \"userid\":$owner_id
                }";
	}
	
}
?>